/**
 *!
 * \file        b_drv_key.h
 * \version     v0.0.1
 * \date        2020/03/25
 * \author      Bean(notrynohigh@outlook.com)
 *******************************************************************************
 * @attention

 */
#ifndef __B_DRV_STEPMOTOR_H__
#define __B_DRV_STEPMOTOR_H__

#ifdef __cplusplus
extern "C" {
#endif

/*Includes ----------------------------------------------*/
#include "drivers/inc/b_driver.h"
/**
 * \addtogroup B_DRIVER
 * \{
 */

/**
 * \addtogroup STEPMOTOR
 * \{
 */

/**
 * \defgroup STEPMOTOR_Exported_TypesDefinitions
 * \{
 */
//<HALIF 1 GPIO
typedef struct
{
    bHalGPIOInstance_t INA1;
    bHalGPIOInstance_t INA2;
    bHalGPIOInstance_t INB1;
    bHalGPIOInstance_t INB2;
    bHalGPIOInstance_t pwr_en;
    int32_t fwd_limit_position;
    int32_t rev_limit_position;
} bSTEPMOTOR_HalIf_t;
/**
 * \}
 */

/**
 * \}
 */

/**
 * \}
 */
// 此函数必需放入精准的定时中运行。如2ms定时器
void drv_motor_process_isr(void) ;

// 电机堵转检测，需要放入adc中断中快速check
uint8_t drv_motor_check_isr(uint32_t current);

#ifdef __cplusplus
}
#endif

#endif

/************************ Copyright (c) 2020 Bean *****END OF FILE****/
